<?php
require '../../../zb_system/function/c_system_base.php';
require '../../../zb_system/function/c_system_admin.php';

$zbp->Load();
$action = 'root';
if (!$zbp->CheckRights($action)) {
    $zbp->ShowError(6);
    die();
}
if (!$zbp->CheckPlugin('Long')) {
    $zbp->ShowError(48);
    die();
}
$blogtitle = 'Long主题配置';

if (isset($_POST['weibonet'])) {
    global $zbp;
    $zbp->Config('Long')->weibonet = $_POST['weibonet'];
    $zbp->SaveConfig('Long');
    $zbp->ShowHint('good');
}


if (!$zbp->CheckRights($action)) {$zbp->mokeError(6);die();}
if (!$zbp->CheckPlugin('Long')) {$zbp->mokeError(48);die();}
 
if($_GET['type'] == 'logo' ){
   global $zbp;
   foreach ($_FILES as $key => $value) {
           //判断上传是否成功
         if (is_uploaded_file($_FILES[$key]['tmp_name'])) {
             //获取本地图片上传到服务器上的临时位置
            $tmp_name = $_FILES[$key]['tmp_name'];
            //将图片从临时位置移动到图片目录
            @move_uploaded_file($_FILES[$key]['tmp_name'], $zbp->usersdir . 'theme/Long/style/images/logo.png');
         }
   }
   $zbp->SetHint('good','修改成功');//提示信息
   Redirect('main.php?act=config');//跳转页面
}





require $blogpath.'zb_system/admin/admin_header.php';
require $blogpath.'zb_system/admin/admin_top.php';
?>
 
<div id="divMain">
  <div class="divHeader2"><?php echo $blogtitle; ?></div>
  <div class="SubMenu"></div>
  <div id="divMain2">
    <form id="form-postdata" name="form-postdata" method="post" enctype="multipart/form-data" action="main.php">
      <table width="100%" border="1" width="100%" class="tableBorder">
      <tr>
        <th scope="col" height="32" width="150px">配置项</th>
        <th scope="col">配置内容</th>
        <th scope="col" width="500px">使用说明</th>
      </tr>
      <tr>
        <td scope="row">底部微博链接</td>
        <td><input name="weibonet" type="text" value="<?php echo $zbp->Config('Long')->weibonet; ?>"></input></td>
        <td>底部微博超链接地址,http://开头</td>
        <td><input class="button" type="submit" value="保存设置" /></td>
      </tr>
   </table>
        <br/>
        
    </form>

    <table id="form1" name="form1" width="100%" style="padding:0;margin:0;" cellspacing="0" cellpadding="0" class="tableBorder">
        <tr>
            <th width="30%"><p align="center">选项名称</p></th>
            <th width="20%"><p align="center">当前图片</p></th>
            <th width="50%"><p align="center">上传图片</p></th>
        </tr>
        <form enctype="multipart/form-data" method="post" action="main.php?type=logo">
            <tr>
                <td><p align="center">LOGO图片</p></td>
                <td>
                    <p align="center"><a href="style/images/logo.png" target="_blank">
                            <img src="style/images/logo.png" height="40px"></a></p>
                </td>
                <td>
                    <p align="center">
                        <input name="logo" type="file"/>
                        <input name="" type="Submit" class="button" value="保存"/>
                    </p>
                </td>
            </tr>
        </form>
  </div>

</div>
<?php
require $blogpath.'zb_system/admin/admin_footer.php';
?>